<?php
define('BASEDIR',__DIR__);
include BASEDIR . '/IMooc/Loader.php';
spl_autoload_register('\\Imooc\\Loader::autoload');


// 堆
$heap = new SplMinHeap();
$heap->insert("data1\n");
$heap->insert("data2\n");
echo $heap->extract();  // data1
echo $heap->extract();  // data2


//  队列
//$queue = new SplQueue();
//$queue->enqueue("data1\n");
//$queue->enqueue("data2\n");
//echo $queue->dequeue();   // data1
//echo $queue->dequeue();   // data2


// PHP栈
//$stack = new SplStack();
//$stack->push("data1\n");
//$stack->push("data2\n");
//echo $stack->pop();   // data2
//echo $stack->pop();   // data1